{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# Regression with Taxi Dataset"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "This notebook demonstrates how to:\n",
        "\n",
        "1. Define the model input and output schema\n",
        "1. Load in data from a text file to an IDataView\n",
        "1. Set up the training pipeline with data transforms\n",
        "1. Choose an algorithm and append it to the pipeline\n",
        "1. Train the model\n",
        "1. Evaluate the model\n",
        "1. Consume the model"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Install the necessary NuGet packages for training ML.NET model and plotting:"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "dotnet_interactive": {
          "language": "csharp"
        }
      },
      "source": [
        "// using nightly-build\n",
        "#i \"nuget:https://pkgs.dev.azure.com/dnceng/public/_packaging/MachineLearning/nuget/v3/index.json\"\n",
        "#r \"nuget: Plotly.NET.Interactive, 3.0.2\"\n",
        "#r \"nuget: Plotly.NET.CSharp, 0.0.1\"\n",
        "#r \"nuget: Microsoft.ML.AutoML, 0.20.0-preview.22356.1\"\n",
        "#r \"nuget: Microsoft.Data.Analysis, 0.20.0-preview.22356.1\""
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div><div><strong>Restore sources</strong><ul><li><span>https://pkgs.dev.azure.com/dnceng/public/_packaging/MachineLearning/nuget/v3/index.json</span></li></ul></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Microsoft.Data.Analysis, 0.20.0-preview.22356.1</span></li><li><span>Microsoft.ML.AutoML, 0.20.0-preview.22356.1</span></li><li><span>Plotly.NET.CSharp, 0.0.1</span></li><li><span>Plotly.NET.Interactive, 3.0.2</span></li></ul></div></div>"
            ]
          },
          "execution_count": 1,
          "metadata": {}
        },
        {
          "output_type": "execute_result",
          "data": {
            "text/markdown": [
              "Loading extensions from `Plotly.NET.Interactive.dll`"
            ]
          },
          "execution_count": 1,
          "metadata": {}
        },
        {
          "output_type": "execute_result",
          "data": {
            "text/markdown": [
              "Loading extensions from `Microsoft.ML.AutoML.Interactive.dll`"
            ]
          },
          "execution_count": 1,
          "metadata": {}
        },
        {
          "output_type": "execute_result",
          "data": {
            "text/markdown": [
              "Loading extensions from `Microsoft.Data.Analysis.Interactive.dll`"
            ]
          },
          "execution_count": 1,
          "metadata": {}
        }
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "dotnet_interactive": {
          "language": "csharp"
        }
      },
      "source": [
        "\n",
        "// Import common usings.\n",
        "using static Microsoft.DotNet.Interactive.Formatting.PocketViewTags;\n",
        "using static Microsoft.ML.Transforms.OneHotEncodingEstimator;\n",
        "using Microsoft.Data.Analysis;\n",
        "using System;\n",
        "using System.IO;\n",
        "using Microsoft.ML;\n",
        "using Microsoft.ML.AutoML;\n",
        "using Microsoft.ML.Data;"
      ],
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "#### Download or Locate Data\n",
        "The following code tries to locate the data file in a few known locations or it will download it from the known GitHub location."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "dotnet_interactive": {
          "language": "csharp"
        }
      },
      "source": [
        "using System;\n",
        "using System.IO;\n",
        "using System.Net;\n",
        "\n",
        "string EnsureDataSetDownloaded(string fileName)\n",
        "{\n",
        "\n",
        "\t// This is the path if the repo has been checked out.\n",
        "\tvar filePath = Path.Combine(Directory.GetCurrentDirectory(),\"data\", fileName);\n",
        "\n",
        "\tif (!File.Exists(filePath))\n",
        "\t{\n",
        "\t\t// This is the path if the file has already been downloaded.\n",
        "\t\tfilePath = Path.Combine(Directory.GetCurrentDirectory(), fileName);\n",
        "\t}\n",
        "\n",
        "\tif (!File.Exists(filePath))\n",
        "\t{\n",
        "\t\tusing (var client = new WebClient())\n",
        "\t\t{\n",
        "\t\t\tclient.DownloadFile($\"https://raw.githubusercontent.com/dotnet/csharp-notebooks/main/machine-learning/data/{fileName}\", filePath);\n",
        "\t\t}\n",
        "\t\tConsole.WriteLine($\"Downloaded {fileName}  to : {filePath}\");\n",
        "\t}\n",
        "\telse\n",
        "\t{\n",
        "\t\tConsole.WriteLine($\"{fileName} found here: {filePath}\");\n",
        "\t}\n",
        "\n",
        "\treturn filePath;\n",
        "}"
      ],
      "outputs": []
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "dotnet_interactive": {
          "language": "csharp"
        }
      },
      "source": [
        "//Load File\n",
        "var trainDataPath = EnsureDataSetDownloaded(\"taxi-fare.csv\");\n",
        "var df = DataFrame.LoadCsv(trainDataPath);\n",
        "var mlContext = new MLContext();\n",
        "\n",
        "// Append the trainer to the data processing pipeline\n",
        "var pipeline = mlContext.Auto().Featurizer(df, excludeColumns: new[]{\"fare_amount\"})\n",
        "                 .Append(mlContext.Auto().Regression(labelColumnName: \"fare_amount\"));\n",
        "\n",
        "// Configure AutoML\n",
        "var trainTestSplit = mlContext.Data.TrainTestSplit(df, 0.2);\n",
        "var validateTestSplit = mlContext.Data.TrainTestSplit(trainTestSplit.TestSet, 0.5);\n",
        "var monitor = new NotebookMonitor();\n",
        "\n",
        " var experiment = mlContext.Auto().CreateExperiment()\n",
        "                    .SetPipeline(pipeline)\n",
        "                    .SetTrainingTimeInSeconds(50)\n",
        "                    .SetDataset(trainTestSplit.TrainSet, validateTestSplit.TrainSet)\n",
        "                    .SetEvaluateMetric(RegressionMetric.RSquared, \"fare_amount\", \"Score\")\n",
        "\t\t\t\t\t.SetMonitor(monitor);\n",
        "\n",
        "\t\t\t\t\t// Configure Visualizer\t\t\t\n",
        "monitor.SetUpdate(monitor.Display());\n",
        "\n",
        "// Start Experiment\n",
        "var result = await experiment.RunAsync();"
      ],
      "outputs": [
        {
          "output_type": "error",
          "ename": "",
          "evalue": "(3,10): error CS0103: The name 'DataFrame' does not exist in the current context\r\n(4,21): error CS0246: The type or namespace name 'MLContext' could not be found (are you missing a using directive or an assembly reference?)\r\n(13,19): error CS0246: The type or namespace name 'NotebookMonitor' could not be found (are you missing a using directive or an assembly reference?)\r\n(19,40): error CS0103: The name 'RegressionMetric' does not exist in the current context",
          "traceback": [
            null
          ]
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Consume the model"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "dotnet_interactive": {
          "language": "csharp"
        }
      },
      "source": [
        "// Define sample data\n",
        "var data  = new DataFrame(new StringDataFrameColumn(\"vendor_id\"), new PrimitiveDataFrameColumn<float>(\"rate_code\"), new PrimitiveDataFrameColumn<float>(\"passenger_count\"), new PrimitiveDataFrameColumn<float>(\"trip_time_in_secs\"), new PrimitiveDataFrameColumn<float>(\"trip_distance\"),new StringDataFrameColumn(\"payment_type\"));\n",
        "data.Append(new List<KeyValuePair<string,object>>()\n",
        "{\n",
        "\tnew KeyValuePair<string,object>(\"vendor_id\",@\"CMT\"),\n",
        "\tnew KeyValuePair<string,object>(\"rate_code\",1F),\n",
        "\tnew KeyValuePair<string,object>(\"passenger_count\",1F),\n",
        "\tnew KeyValuePair<string, object> (\"trip_time_in_secs\",474F),\n",
        "\tnew KeyValuePair<string, object> (\"trip_distance\",1.5F),\n",
        "\tnew KeyValuePair<string, object> (\"payment_type\",@\"payment_type\")\n",
        "},true);\n",
        "var model = result.Model;\n",
        "\n",
        "//Use the model to transform the sample data.\n",
        "var output = model.Transform(data);\n",
        "\n",
        "// Get the predicted score with the sample data.\n",
        "var predictedScore = output.GetColumn<float>(\"Score\");\n",
        "predictedScore\n",
        "\t\t\t\n",
        "\t\t\t"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<table><thead><tr><th><i>index</i></th><th>value</th></tr></thead><tbody><tr><td>0</td><td><div class=\"dni-plaintext\">8.47422</div></td></tr></tbody></table>"
            ]
          },
          "execution_count": 1,
          "metadata": {}
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Evaluate model"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "dotnet_interactive": {
          "language": "csharp"
        }
      },
      "source": [
        "var model = result.Model;\n",
        "var eval= model.Transform(validateTestSplit.TestSet);\n",
        "var metric=mlContext.Regression.Evaluate(eval,\"fare_amount\");\n",
        "metric\t"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<table><thead><tr><th>MeanAbsoluteError</th><th>MeanSquaredError</th><th>RootMeanSquaredError</th><th>LossFunction</th><th>RSquared</th></tr></thead><tbody><tr><td><div class=\"dni-plaintext\">0.9971379424072447</div></td><td><div class=\"dni-plaintext\">7.954096814346052</div></td><td><div class=\"dni-plaintext\">2.8203008375607825</div></td><td><div class=\"dni-plaintext\">7.954096719333472</div></td><td><div class=\"dni-plaintext\">0.913846968172443</div></td></tr></tbody></table>"
            ]
          },
          "execution_count": 1,
          "metadata": {}
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n",
        "\n",
        "The code below demonstrates several methods to explain your model, including how to get and display\n",
        "\n",
        "1. A Histogram of the distribution of number of instances\n",
        "1. A Scatter Plot\n",
        "1. Compare actual values to predicted values in a scatter plot\n",
        "1. The importance of different features"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "dotnet_interactive": {
          "language": "csharp"
        }
      },
      "source": [
        "using System;\n",
        "using System.Collections.Generic;\n",
        "using System.Collections.Immutable;\n",
        "using System.IO;\n",
        "using System.Linq;\n",
        "using Plotly.NET.CSharp;\n",
        "using Plotly.NET;"
      ],
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Compare Distribution of Number of Instances"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "dotnet_interactive": {
          "language": "csharp"
        }
      },
      "source": [
        "// Extract some data into arrays for plotting\n",
        "\n",
        "int numberOfRows = 1000;\n",
        "\n",
        "// Columns was determined by inputted data\n",
        "float[] fare_amount = df.GetColumn<float>(\"fare_amount\").Take(numberOfRows).ToArray();\n",
        "\n",
        "// Distribution of Number of Instances\n",
        "\n",
        "Plotly.NET.Chart2D.Chart.Histogram<float,float, string>(fare_amount)\n",
        ".WithXAxisStyle<float, float, string>(TitleText: \"fare_amount\")\n",
        ".WithYAxisStyle<float, float, string>(TitleText: \"Number of Instances\")"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "\n",
              "<div>\n",
              "    <div id=\"500d7db0-b21e-4981-ace9-a8433587122e\"><!-- Plotly chart will be drawn inside this DIV --></div>\r\n",
              "<script type=\"text/javascript\">\r\n",
              "\r\n",
              "            var renderPlotly_500d7db0b21e4981ace9a8433587122e = function() {\r\n",
              "            var fsharpPlotlyRequire = requirejs.config({context:'fsharp-plotly',paths:{plotly:'https://cdn.plot.ly/plotly-2.6.3.min'}}) || require;\r\n",
              "            fsharpPlotlyRequire(['plotly'], function(Plotly) {\r\n",
              "\r\n",
              "            var data = [{\"type\":\"histogram\",\"x\":[17.5,8.0,8.5,4.5,8.5,27.5,11.5,7.5,7.5,5.0,6.0,7.0,7.0,5.5,7.0,19.0,6.0,6.5,9.0,4.5,52.0,6.5,3.5,4.5,8.5,5.5,32.0,8.5,8.5,9.0,4.0,7.0,16.0,7.5,11.5,8.0,5.5,5.0,7.0,19.5,52.0,10.0,7.0,5.0,24.5,9.5,12.5,4.0,7.0,5.5,17.5,7.0,33.5,5.5,7.0,23.0,11.5,6.5,6.5,11.5,13.0,9.0,10.5,18.5,11.0,5.5,6.5,7.0,4.5,7.5,13.0,8.0,6.5,52.0,8.5,12.0,10.0,4.0,20.0,7.0,16.0,4.5,10.0,17.5,4.5,4.5,5.5,5.0,8.0,15.0,6.0,13.0,23.5,7.0,4.5,4.0,6.5,8.0,6.5,7.5,10.5,7.0,11.5,5.5,8.5,6.0,21.0,5.5,19.0,3.5,5.5,31.0,12.0,11.0,17.0,7.0,5.0,8.5,12.0,5.0,11.5,7.0,11.5,15.0,4.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0,4.5,6.5,10.0,7.0,7.0,26.5,7.5,10.0,7.0,10.0,11.5,4.0,8.0,12.0,4.0,5.5,9.5,15.5,7.0,15.5,3.5,2.5,9.0,5.0,6.0,5.5,30.5,3.0,16.0,7.0,5.5,39.5,35.0,5.5,3.5,8.5,12.0,8.0,7.0,7.5,7.5,14.5,7.0,20.5,21.5,6.0,6.5,6.5,8.0,13.5,5.5,39.0,6.0,17.0,12.5,24.5,11.0,10.0,7.0,15.5,9.5,22.0,17.0,8.0,22.0,7.0,8.0,15.5,12.0,3.0,9.0,14.5,16.5,6.5,13.5,7.5,25.5,13.0,14.0,15.5,5.5,5.0,14.5,9.0,5.0,6.5,4.5,8.5,14.0,40.0,5.0,10.5,6.0,8.0,34.0,11.0,6.5,6.0,9.0,7.0,10.5,15.0,8.0,4.5,11.0,6.0,10.5,12.0,17.0,5.0,5.0,11.5,24.5,52.0,4.5,4.0,6.0,14.0,5.0,8.0,12.0,5.0,14.0,7.0,14.0,7.0,9.5,9.5,12.0,20.0,6.0,12.5,7.5,4.5,25.5,4.5,14.0,10.0,12.5,7.5,9.0,6.5,8.5,4.0,8.5,4.0,7.0,37.5,20.0,15.5,5.0,8.5,7.5,15.5,13.5,6.5,8.5,3.5,8.5,7.5,6.5,5.5,18.0,7.0,16.0,28.0,9.5,15.0,6.5,31.5,5.0,30.5,5.5,11.0,14.5,10.5,7.0,34.0,10.0,9.0,11.5,5.0,2.5,5.0,8.5,4.5,11.0,6.0,23.5,11.5,2.5,9.5,11.5,24.5,25.0,14.0,11.5,9.0,10.5,15.5,26.5,15.0,6.0,11.5,9.5,25.0,9.5,6.0,6.5,6.5,4.0,6.5,13.5,10.5,9.0,9.0,4.0,4.5,8.5,13.5,5.0,19.0,15.5,9.0,4.5,17.5,7.0,34.5,10.0,21.0,11.0,10.0,19.5,15.5,7.5,5.0,7.5,5.5,13.5,8.5,15.0,5.5,5.0,11.0,6.5,4.0,4.0,8.5,8.0,6.0,8.5,17.0,9.5,26.5,4.0,5.0,6.5,7.0,8.5,28.5,5.0,7.0,7.0,4.5,10.5,13.5,8.0,4.5,15.0,7.5,11.0,5.5,6.5,19.5,5.0,6.5,4.5,8.0,14.0,9.0,24.0,6.5,13.0,5.0,12.0,4.5,8.0,32.5,21.5,6.5,5.0,2.5,16.5,9.5,8.5,8.5,10.5,7.0,13.0,15.0,6.5,13.0,5.5,13.0,8.0,24.5,12.0,7.5,8.0,7.5,11.0,11.0,9.5,7.0,4.0,6.5,14.5,10.0,8.5,7.0,6.5,5.5,14.0,3.5,11.0,8.0,7.0,12.0,5.0,6.5,8.5,14.0,6.0,10.0,14.0,11.0,12.0,4.5,6.0,16.0,19.0,16.0,8.0,6.0,7.0,22.5,3.5,7.5,7.0,5.5,11.5,4.0,8.5,14.5,11.5,5.5,11.5,6.0,11.0,9.5,19.5,9.5,8.5],\"marker\":{}}];\r\n",
              "            var layout = {\"width\":600,\"height\":600,\"template\":{\"layout\":{\"title\":{\"x\":0.05},\"font\":{\"color\":\"rgba(42, 63, 95, 1.0)\"},\"paper_bgcolor\":\"rgba(255, 255, 255, 1.0)\",\"plot_bgcolor\":\"rgba(229, 236, 246, 1.0)\",\"autotypenumbers\":\"strict\",\"colorscale\":{\"diverging\":[[0.0,\"#8e0152\"],[0.1,\"#c51b7d\"],[0.2,\"#de77ae\"],[0.3,\"#f1b6da\"],[0.4,\"#fde0ef\"],[0.5,\"#f7f7f7\"],[0.6,\"#e6f5d0\"],[0.7,\"#b8e186\"],[0.8,\"#7fbc41\"],[0.9,\"#4d9221\"],[1.0,\"#276419\"]],\"sequential\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"sequentialminus\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]},\"hovermode\":\"closest\",\"hoverlabel\":{\"align\":\"left\"},\"coloraxis\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}},\"geo\":{\"showland\":true,\"landcolor\":\"rgba(229, 236, 246, 1.0)\",\"showlakes\":true,\"lakecolor\":\"rgba(255, 255, 255, 1.0)\",\"subunitcolor\":\"rgba(255, 255, 255, 1.0)\",\"bgcolor\":\"rgba(255, 255, 255, 1.0)\"},\"mapbox\":{\"style\":\"light\"},\"polar\":{\"bgcolor\":\"rgba(229, 236, 246, 1.0)\",\"radialaxis\":{\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"ticks\":\"\"},\"angularaxis\":{\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"ticks\":\"\"}},\"scene\":{\"xaxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"gridwidth\":2.0,\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"backgroundcolor\":\"rgba(229, 236, 246, 1.0)\",\"showbackground\":true},\"yaxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"gridwidth\":2.0,\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"backgroundcolor\":\"rgba(229, 236, 246, 1.0)\",\"showbackground\":true},\"zaxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"gridwidth\":2.0,\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"backgroundcolor\":\"rgba(229, 236, 246, 1.0)\",\"showbackground\":true}},\"ternary\":{\"aaxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\"},\"baxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\"},\"caxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\"},\"bgcolor\":\"rgba(229, 236, 246, 1.0)\"},\"xaxis\":{\"title\":{\"standoff\":15},\"ticks\":\"\",\"automargin\":true,\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"zerolinewidth\":2.0},\"yaxis\":{\"title\":{\"standoff\":15},\"ticks\":\"\",\"automargin\":true,\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"zerolinewidth\":2.0},\"annotationdefaults\":{\"arrowcolor\":\"#2a3f5f\",\"arrowhead\":0,\"arrowwidth\":1},\"shapedefaults\":{\"line\":{\"color\":\"rgba(42, 63, 95, 1.0)\"}},\"colorway\":[\"rgba(99, 110, 250, 1.0)\",\"rgba(239, 85, 59, 1.0)\",\"rgba(0, 204, 150, 1.0)\",\"rgba(171, 99, 250, 1.0)\",\"rgba(255, 161, 90, 1.0)\",\"rgba(25, 211, 243, 1.0)\",\"rgba(255, 102, 146, 1.0)\",\"rgba(182, 232, 128, 1.0)\",\"rgba(255, 151, 255, 1.0)\",\"rgba(254, 203, 82, 1.0)\"]},\"data\":{\"bar\":[{\"marker\":{\"line\":{\"color\":\"rgba(229, 236, 246, 1.0)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"error_x\":{\"color\":\"rgba(42, 63, 95, 1.0)\"},\"error_y\":{\"color\":\"rgba(42, 63, 95, 1.0)\"}}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"rgba(229, 236, 246, 1.0)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}}}],\"carpet\":[{\"aaxis\":{\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"endlinecolor\":\"rgba(42, 63, 95, 1.0)\",\"minorgridcolor\":\"rgba(255, 255, 255, 1.0)\",\"startlinecolor\":\"rgba(42, 63, 95, 1.0)\"},\"baxis\":{\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"endlinecolor\":\"rgba(42, 63, 95, 1.0)\",\"minorgridcolor\":\"rgba(255, 255, 255, 1.0)\",\"startlinecolor\":\"rgba(42, 63, 95, 1.0)\"}}],\"choropleth\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"contour\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"contourcarpet\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}],\"heatmap\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"heatmapgl\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}}}],\"histogram2d\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"histogram2dcontour\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"mesh3d\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}],\"parcoords\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"pie\":[{\"automargin\":true}],\"scatter\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scatter3d\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}},\"line\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scattercarpet\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scattergeo\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scattergl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scattermapbox\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scatterpolar\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scatterpolargl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scatterternary\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"surface\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"table\":[{\"cells\":{\"fill\":{\"color\":\"rgba(235, 240, 248, 1.0)\"},\"line\":{\"color\":\"rgba(255, 255, 255, 1.0)\"}},\"header\":{\"fill\":{\"color\":\"rgba(200, 212, 227, 1.0)\"},\"line\":{\"color\":\"rgba(255, 255, 255, 1.0)\"}}}]}},\"xaxis\":{\"title\":{\"text\":\"fare_amount\"}},\"yaxis\":{\"title\":{\"text\":\"Number of Instances\"}}};\r\n",
              "            var config = {\"responsive\":true};\r\n",
              "            Plotly.newPlot('500d7db0-b21e-4981-ace9-a8433587122e', data, layout, config);\r\n",
              "});\r\n",
              "            };\r\n",
              "            if ((typeof(requirejs) !==  typeof(Function)) || (typeof(requirejs.config) !== typeof(Function))) {\r\n",
              "                var script = document.createElement(\"script\");\r\n",
              "                script.setAttribute(\"src\", \"https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js\");\r\n",
              "                script.onload = function(){\r\n",
              "                    renderPlotly_500d7db0b21e4981ace9a8433587122e();\r\n",
              "                };\r\n",
              "                document.getElementsByTagName(\"head\")[0].appendChild(script);\r\n",
              "            }\r\n",
              "            else {\r\n",
              "                renderPlotly_500d7db0b21e4981ace9a8433587122e();\r\n",
              "            }\r\n",
              "</script>\r\n",
              "\n",
              "    \n",
              "</div>    \n"
            ]
          },
          "execution_count": 1,
          "metadata": {}
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Compare actual values to predicted values in a scatter plot"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "dotnet_interactive": {
          "language": "csharp"
        }
      },
      "source": [
        "// Number of rows to display in charts.\n",
        "int numberOfRows = 1000;\n",
        "// Use the model to make batch predictions on training data\n",
        "var testResults = model.Transform(df);\n",
        "\n",
        "// Get the actual values from the dataset\n",
        "var trueValues = testResults.GetColumn<float>(\"fare_amount\").Take(numberOfRows);;\n",
        "\n",
        "// Get the predicted values from the test results\n",
        "var predictedValues = testResults.GetColumn<float>(\"Score\").Take(numberOfRows);\n",
        "\n",
        "var scatter = Plotly.NET.CSharp.Chart.Scatter<float, float, string>(x: trueValues, y: predictedValues, mode: Plotly.NET.StyleParam.Mode.Markers)\n",
        ".WithTraceInfo(\"True Values, Predicted Values\", ShowLegend: true);\n",
        "\n",
        "var maximumValue = Math.Max(trueValues.Max(), predictedValues.Max());\n",
        "var perfectLine = Plotly.NET.CSharp.Chart.Scatter<float, float, string>(x:new[] {0, maximumValue}, y: new[] {0, maximumValue}, mode: Plotly.NET.StyleParam.Mode.Lines)\n",
        ".WithTraceInfo(\"Perfect Line\", ShowLegend: true);\n",
        "\n",
        "\n",
        "Plotly.NET.CSharp.Chart.Combine(new []{scatter, perfectLine})\n",
        ".WithXAxisStyle<double, double, string>(TitleText: \"X\", ShowGrid: false)"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "\n",
              "<div>\n",
              "    <div id=\"30ffb494-4c64-4b89-9ca2-8e92f747a6de\"><!-- Plotly chart will be drawn inside this DIV --></div>\r\n",
              "<script type=\"text/javascript\">\r\n",
              "\r\n",
              "            var renderPlotly_30ffb4944c644b899ca28e92f747a6de = function() {\r\n",
              "            var fsharpPlotlyRequire = requirejs.config({context:'fsharp-plotly',paths:{plotly:'https://cdn.plot.ly/plotly-2.6.3.min'}}) || require;\r\n",
              "            fsharpPlotlyRequire(['plotly'], function(Plotly) {\r\n",
              "\r\n",
              "            var data = [{\"type\":\"scatter\",\"mode\":\"markers\",\"x\":[17.5,8.0,8.5,4.5,8.5,27.5,11.5,7.5,7.5,5.0,6.0,7.0,7.0,5.5,7.0,19.0,6.0,6.5,9.0,4.5,52.0,6.5,3.5,4.5,8.5,5.5,32.0,8.5,8.5,9.0,4.0,7.0,16.0,7.5,11.5,8.0,5.5,5.0,7.0,19.5,52.0,10.0,7.0,5.0,24.5,9.5,12.5,4.0,7.0,5.5,17.5,7.0,33.5,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3.0,8.5,17.5,8.0,5.5,12.0,12.5,4.0,9.5,7.0,13.0,5.0,10.0,4.0,5.0,12.0,10.0,9.5,4.5,7.0,4.0,10.5,9.5,4.0,14.0,7.5,4.0,11.5,4.5,24.0,29.5,9.5,17.5,13.5,10.5,6.0,8.0,13.0,6.0,7.5,5.0,3.5,10.0,6.0,6.5,11.5,35.0,5.5,11.5,12.0,8.0,17.5,5.0,6.5,6.5,5.0,13.0,11.0,32.5,12.0,11.0,7.5,8.0,11.5,6.0,11.0,15.0,13.0,9.5,25.0,9.5,7.0,4.5,6.5,10.0,7.0,7.0,26.5,7.5,10.0,7.0,10.0,11.5,4.0,8.0,12.0,4.0,5.5,9.5,15.5,7.0,15.5,3.5,2.5,9.0,5.0,6.0,5.5,30.5,3.0,16.0,7.0,5.5,39.5,35.0,5.5,3.5,8.5,12.0,8.0,7.0,7.5,7.5,14.5,7.0,20.5,21.5,6.0,6.5,6.5,8.0,13.5,5.5,39.0,6.0,17.0,12.5,24.5,11.0,10.0,7.0,15.5,9.5,22.0,17.0,8.0,22.0,7.0,8.0,15.5,12.0,3.0,9.0,14.5,16.5,6.5,13.5,7.5,25.5,13.0,14.0,15.5,5.5,5.0,14.5,9.0,5.0,6.5,4.5,8.5,14.0,40.0,5.0,10.5,6.0,8.0,34.0,11.0,6.5,6.0,9.0,7.0,10.5,15.0,8.0,4.5,11.0,6.0,10.5,12.0,17.0,5.0,5.0,11.5,24.5,52.0,4.5,4.0,6.0,14.0,5.0,8.0,12.0,5.0,14.0,7.0,14.0,7.0,9.5,9.5,12.0,20.0,6.0,12.5,7.5,4.5,25.5,4.5,14.0,10.0,12.5,7.5,9.0,6.5,8.5,4.0,8.5,4.0,7.0,37.5,20.0,15.5,5.0,8.5,7.5,15.5,13.5,6.5,8.5,3.5,8.5,7.5,6.5,5.5,18.0,7.0,16.0,28.0,9.5,15.0,6.5,31.5,5.0,30.5,5.5,11.0,14.5,10.5,7.0,34.0,10.0,9.0,11.5,5.0,2.5,5.0,8.5,4.5,11.0,6.0,23.5,11.5,2.5,9.5,11.5,24.5,25.0,14.0,11.5,9.0,10.5,15.5,26.5,15.0,6.0,11.5,9.5,25.0,9.5,6.0,6.5,6.5,4.0,6.5,13.5,10.5,9.0,9.0,4.0,4.5,8.5,13.5,5.0,19.0,15.5,9.0,4.5,17.5,7.0,34.5,10.0,21.0,11.0,10.0,19.5,15.5,7.5,5.0,7.5,5.5,13.5,8.5,15.0,5.5,5.0,11.0,6.5,4.0,4.0,8.5,8.0,6.0,8.5,17.0,9.5,26.5,4.0,5.0,6.5,7.0,8.5,28.5,5.0,7.0,7.0,4.5,10.5,13.5,8.0,4.5,15.0,7.5,11.0,5.5,6.5,19.5,5.0,6.5,4.5,8.0,14.0,9.0,24.0,6.5,13.0,5.0,12.0,4.5,8.0,32.5,21.5,6.5,5.0,2.5,16.5,9.5,8.5,8.5,10.5,7.0,13.0,15.0,6.5,13.0,5.5,13.0,8.0,24.5,12.0,7.5,8.0,7.5,11.0,11.0,9.5,7.0,4.0,6.5,14.5,10.0,8.5,7.0,6.5,5.5,14.0,3.5,11.0,8.0,7.0,12.0,5.0,6.5,8.5,14.0,6.0,10.0,14.0,11.0,12.0,4.5,6.0,16.0,19.0,16.0,8.0,6.0,7.0,22.5,3.5,7.5,7.0,5.5,11.5,4.0,8.5,14.5,11.5,5.5,11.5,6.0,11.0,9.5,19.5,9.5,8.5],\"y\":[16.838041,7.361545,8.431691,4.674591,8.431691,26.401894,11.528299,7.361545,6.1312222,4.674591,6.1312222,7.361545,6.1312222,6.1312222,6.1312222,17.369656,6.1312222,6.1312222,8.431691,4.674591,52.276676,7.361545,4.674591,4.674591,8.431691,6.1312222,29.518507,7.361545,8.431691,9.940377,4.674591,7.361545,13.721427,7.361545,11.016348,7.361545,6.1312222,4.674591,7.361545,20.48627,49.981953,9.940377,7.361545,4.674591,24.948835,8.431691,11.528299,4.674591,6.1312222,6.1312222,16.838041,7.361545,32.61158,6.1312222,6.1312222,24.948835,13.2094755,6.1312222,6.1312222,13.2094755,12.133505,9.507662,11.528299,16.857704,9.940377,4.674591,6.1312222,6.1312222,4.674591,6.1312222,13.2094755,7.361545,6.1312222,53.075024,7.361545,11.528299,9.507662,4.674591,17.369656,7.361545,13.721427,4.674591,9.940377,17.369656,4.674591,4.674591,6.1312222,6.1312222,7.361545,12.133505,6.1312222,13.721427,23.579344,6.1312222,4.674591,4.674591,6.1312222,7.361545,7.361545,7.361545,11.016348,7.361545,11.528299,6.1312222,8.431691,6.1312222,20.244299,4.674591,16.838041,4.674591,6.1312222,34.024048,11.528299,11.016348,16.838041,7.361545,4.674591,8.870231,11.528299,4.674591,12.133505,7.361545,11.528299,13.721427,4.674591,11.528299,13.721427,29.518507,7.361545,32.61158,12.133505,6.1312222,7.361545,4.674591,6.1312222,8.431691,6.1312222,9.940377,20.48627,12.133505,8.870231,6.1312222,15.379109,8.431691,13.721427,6.1312222,4.674591,7.361545,6.1312222,13.2094755,13.721427,13.721427,4.674591,7.361545,4.674591,6.1312222,9.940377,7.361545,4.674591,20.48627,4.674591,8.431691,6.1312222,4.674591,8.431691,7.361545,4.674591,4.674591,6.1312222,10.019613,6.1312222,7.6399083,4.674591,7.6399083,13.870423,6.1312222,4.674591,32.61158,11.528299,10.019613,6.1312222,7.361545,8.870231,13.721427,9.940377,6.1312222,7.361545,11.528299,6.1312222,10.019613,8.431691,11.016348,12.133505,4.674591,7.361545,17.369656,13.870423,4.674591,6.1312222,13.721427,9.940377,9.940377,9.940377,53.075024,11.063358,10.019613,6.1312222,8.431691,8.431691,6.1312222,4.674591,13.721427,6.1312222,6.1312222,6.1312222,6.1312222,16.838041,8.431691,66.41911,4.674591,6.1312222,8.431691,7.361545,11.528299,13.721427,6.1312222,29.518507,4.674591,7.361545,7.361545,8.431691,8.431691,4.674591,7.6399083,6.1312222,49.981953,20.48627,8.870231,7.361545,13.721427,9.507662,8.431691,8.870231,16.838041,6.1312222,20.48627,8.431691,9.507662,9.507662,4.674591,7.361545,4.674591,20.48627,8.431691,6.1312222,13.721427,7.361545,11.016348,7.361545,11.016348,11.528299,6.1312222,13.721427,7.361545,8.431691,6.1312222,9.940377,11.528299,6.1312222,6.1312222,6.1312222,12.133505,63.326042,6.1312222,11.528299,13.721427,6.1312222,13.721427,10.019613,8.431691,6.1312222,8.431691,10.019613,6.1312222,6.1312222,9.940377,11.528299,4.674591,11.016348,11.528299,13.721427,6.1312222,16.838041,8.431691,53.075024,13.721427,7.361545,6.1312222,4.674591,29.518507,4.674591,17.369656,6.1312222,4.674591,13.721427,11.016348,4.674591,8.431691,7.361545,12.133505,9.940377,6.1312222,7.361545,13.721427,7.361545,9.940377,13.721427,20.48627,16.838041,4.674591,11.016348,8.431691,7.361545,4.674591,8.431691,13.721427,7.361545,4.674591,8.431691,6.1312222,7.361545,8.431691,6.1312222,4.674591,8.431691,8.870231,13.721427,17.369656,16.838041,6.1312222,13.2094755,6.1312222,8.431691,4.674591,4.674591,4.674591,4.674591,4.674591,7.361545,53.075024,21.83222,17.369656,8.431691,8.431691,8.431691,13.721427,7.361545,9.507662,21.83222,4.674591,8.870231,13.721427,4.674591,8.431691,13.721427,9.507662,4.674591,10.019613,6.1312222,6.1312222,6.1312222,6.1312222,7.361545,11.528299,29.518507,9.940377,6.1312222,6.1312222,7.361545,7.361545,6.1312222,8.870231,12.133505,4.674591,13.721427,11.528299,4.674591,8.870231,7.361545,8.431691,13.2094755,8.431691,11.528299,4.674591,8.431691,4.674591,12.133505,6.1312222,6.1312222,16.838041,4.674591,6.1312222,11.016348,6.1312222,9.940377,13.870423,7.361545,4.674591,8.431691,11.016348,29.518507,6.1312222,7.361545,7.361545,6.1312222,11.016348,11.016348,24.948835,7.361545,11.528299,6.1312222,11.016348,7.361545,7.361545,11.528299,4.674591,17.369656,6.1312222,7.361545,6.1312222,7.361545,7.361545,11.528299,11.528299,9.940377,6.1312222,8.431691,6.1312222,6.1312222,4.674591,7.361545,7.361545,8.431691,6.1312222,7.361545,6.1312222,7.361545,4.674591,4.674591,4.674591,24.948835,8.431691,11.016348,7.361545,10.019613,6.1312222,9.940377,8.431691,13.721427,8.431691,8.431691,16.838041,6.1312222,7.361545,4.674591,6.1312222,4.674591,9.940377,9.940377,8.870231,6.1312222,11.528299,11.528299,8.431691,6.1312222,7.6399083,8.431691,4.674591,6.1312222,8.431691,6.1312222,6.1312222,8.870231,7.361545,7.361545,7.361545,16.838041,13.2094755,4.674591,7.6399083,8.431691,9.940377,6.1312222,17.369656,8.870231,8.431691,24.948835,6.1312222,9.940377,7.361545,8.431691,4.674591,7.361545,7.361545,8.870231,8.870231,20.48627,8.870231,8.431691,8.431691,65.57929,7.361545,6.1312222,10.019613,8.431691,6.1312222,4.674591,7.361545,7.361545,21.83222,7.361545,7.361545,8.431691,6.1312222,8.431691,7.361545,17.369656,29.518507,4.674591,8.431691,6.1312222,7.361545,4.674591,7.361545,6.1312222,9.940377,4.674591,17.369656,6.1312222,9.507662,10.019613,7.361545,6.1312222,6.1312222,11.016348,6.1312222,4.674591,6.1312222,7.361545,8.431691,9.940377,11.016348,8.431691,9.940377,12.133505,12.133505,11.528299,11.016348,13.721427,13.721427,16.838041,4.674591,7.361545,6.1312222,9.940377,4.674591,7.361545,16.838041,7.361545,6.1312222,12.133505,13.721427,4.674591,8.431691,7.361545,13.721427,4.674591,11.016348,4.674591,4.674591,11.528299,9.507662,8.431691,4.674591,7.361545,4.674591,9.940377,12.826567,4.674591,13.721427,7.361545,4.674591,10.019613,4.674591,21.83222,29.518507,8.431691,16.838041,11.528299,12.133505,6.1312222,8.431691,13.721427,6.1312222,7.361545,4.674591,4.674591,9.940377,6.1312222,7.361545,13.2094755,34.024048,6.1312222,11.016348,11.528299,7.361545,16.838041,4.674591,6.1312222,7.361545,4.674591,10.019613,12.133505,29.518507,12.133505,12.133505,7.361545,7.361545,13.2094755,4.674591,12.133505,15.379109,13.721427,8.870231,26.401894,9.940377,7.361545,4.674591,6.1312222,9.940377,6.1312222,7.361545,24.948835,7.361545,9.507662,7.6399083,9.940377,12.133505,4.674591,7.6399083,11.528299,4.674591,6.1312222,8.431691,16.838041,7.361545,15.379109,4.674591,4.674591,8.870231,4.674591,6.1312222,6.1312222,29.518507,4.674591,17.369656,7.361545,6.1312222,37.117123,34.024048,4.674591,4.674591,8.431691,13.2094755,7.361545,6.1312222,7.6399083,7.361545,13.721427,7.361545,20.48627,21.83222,6.1312222,7.361545,6.1312222,7.361545,12.133505,6.1312222,44.15933,6.1312222,16.838041,13.2094755,26.401894,12.133505,11.063358,6.1312222,13.721427,9.507662,20.48627,17.369656,7.6399083,20.244299,6.1312222,7.361545,15.379109,10.019613,4.674591,8.870231,13.721427,17.369656,6.1312222,13.2094755,7.6399083,25.88994,13.721427,13.721427,13.721427,6.1312222,4.674591,16.838041,8.870231,6.1312222,6.1312222,6.1312222,8.870231,13.721427,41.066257,4.674591,12.133505,6.1312222,8.431691,32.61158,9.940377,7.361545,7.361545,9.507662,6.1312222,10.019613,16.838041,8.431691,4.674591,11.528299,4.674591,11.063358,11.016348,16.838041,4.674591,4.674591,9.940377,25.88994,31.348274,4.674591,4.674591,6.1312222,13.721427,6.1312222,8.431691,11.528299,6.1312222,13.721427,6.1312222,13.721427,7.361545,11.063358,7.6399083,13.2094755,20.48627,6.1312222,13.2094755,6.1312222,4.674591,24.948835,4.674591,15.379109,9.940377,12.133505,6.1312222,9.940377,6.1312222,8.870231,4.674591,8.431691,4.674591,6.1312222,37.117123,20.48627,16.838041,6.1312222,7.361545,7.361545,16.838041,15.379109,6.1312222,8.431691,4.674591,8.431691,7.6399083,6.1312222,6.1312222,16.838041,6.1312222,16.857704,29.518507,9.940377,16.838041,4.674591,34.024048,6.1312222,29.518507,6.1312222,11.016348,13.721427,10.019613,6.1312222,32.61158,9.507662,9.507662,11.016348,6.1312222,3.968774,4.674591,8.870231,4.674591,12.133505,6.1312222,21.83222,12.133505,4.674591,9.507662,11.528299,26.401894,24.948835,13.2094755,9.940377,8.431691,11.016348,16.838041,28.041908,13.721427,4.674591,12.133505,9.940377,19.931114,9.940377,6.1312222,6.1312222,6.1312222,4.674591,6.1312222,13.721427,9.940377,8.870231,8.870231,4.674591,4.674591,8.870231,13.721427,4.674591,20.48627,13.721427,9.940377,4.674591,17.369656,6.1312222,32.61158,11.063358,17.369656,12.133505,9.940377,17.369656,13.721427,7.361545,6.1312222,7.361545,6.1312222,13.2094755,7.6399083,16.857704,4.674591,4.674591,11.063358,6.1312222,4.674591,4.674591,8.431691,7.361545,6.1312222,8.870231,13.721427,8.870231,29.518507,4.674591,4.674591,4.674591,6.1312222,7.361545,29.518507,4.674591,7.361545,7.361545,4.674591,11.016348,13.721427,7.361545,4.674591,13.721427,6.1312222,12.133505,4.674591,6.1312222,20.48627,4.674591,6.1312222,4.674591,7.361545,13.721427,7.6399083,24.948835,6.1312222,12.133505,4.674591,11.016348,4.674591,8.431691,29.518507,20.48627,6.1312222,4.674591,4.674591,16.838041,8.870231,8.431691,8.431691,9.940377,6.1312222,13.721427,13.721427,6.1312222,13.2094755,6.1312222,13.721427,8.431691,21.83222,11.016348,6.1312222,7.361545,7.361545,12.133505,11.063358,8.870231,6.1312222,4.674591,6.1312222,13.2094755,8.870231,8.431691,6.1312222,6.1312222,6.1312222,13.721427,4.674591,9.940377,7.361545,7.361545,13.2094755,4.674591,7.361545,7.361545,12.133505,6.1312222,8.870231,13.721427,9.940377,13.2094755,4.674591,6.1312222,16.838041,20.48627,16.838041,8.431691,6.1312222,6.1312222,21.83222,4.674591,7.361545,6.1312222,4.674591,12.133505,4.674591,7.6399083,13.721427,12.133505,6.1312222,11.063358,6.1312222,12.133505,9.940377,20.244299,11.063358,7.6399083],\"marker\":{},\"line\":{},\"name\":\"True Values, Predicted Values\",\"showlegend\":true},{\"type\":\"scatter\",\"mode\":\"lines\",\"x\":[0.0,71.0],\"y\":[0.0,71.0],\"marker\":{},\"line\":{},\"name\":\"Perfect Line\",\"showlegend\":true}];\r\n",
              "            var layout = {\"width\":600,\"height\":600,\"template\":{\"layout\":{\"title\":{\"x\":0.05},\"font\":{\"color\":\"rgba(42, 63, 95, 1.0)\"},\"paper_bgcolor\":\"rgba(255, 255, 255, 1.0)\",\"plot_bgcolor\":\"rgba(229, 236, 246, 1.0)\",\"autotypenumbers\":\"strict\",\"colorscale\":{\"diverging\":[[0.0,\"#8e0152\"],[0.1,\"#c51b7d\"],[0.2,\"#de77ae\"],[0.3,\"#f1b6da\"],[0.4,\"#fde0ef\"],[0.5,\"#f7f7f7\"],[0.6,\"#e6f5d0\"],[0.7,\"#b8e186\"],[0.8,\"#7fbc41\"],[0.9,\"#4d9221\"],[1.0,\"#276419\"]],\"sequential\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"sequentialminus\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]},\"hovermode\":\"closest\",\"hoverlabel\":{\"align\":\"left\"},\"coloraxis\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}},\"geo\":{\"showland\":true,\"landcolor\":\"rgba(229, 236, 246, 1.0)\",\"showlakes\":true,\"lakecolor\":\"rgba(255, 255, 255, 1.0)\",\"subunitcolor\":\"rgba(255, 255, 255, 1.0)\",\"bgcolor\":\"rgba(255, 255, 255, 1.0)\"},\"mapbox\":{\"style\":\"light\"},\"polar\":{\"bgcolor\":\"rgba(229, 236, 246, 1.0)\",\"radialaxis\":{\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"ticks\":\"\"},\"angularaxis\":{\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"ticks\":\"\"}},\"scene\":{\"xaxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"gridwidth\":2.0,\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"backgroundcolor\":\"rgba(229, 236, 246, 1.0)\",\"showbackground\":true},\"yaxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"gridwidth\":2.0,\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"backgroundcolor\":\"rgba(229, 236, 246, 1.0)\",\"showbackground\":true},\"zaxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"gridwidth\":2.0,\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"backgroundcolor\":\"rgba(229, 236, 246, 1.0)\",\"showbackground\":true}},\"ternary\":{\"aaxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\"},\"baxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\"},\"caxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\"},\"bgcolor\":\"rgba(229, 236, 246, 1.0)\"},\"xaxis\":{\"title\":{\"standoff\":15},\"ticks\":\"\",\"automargin\":true,\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"zerolinewidth\":2.0},\"yaxis\":{\"title\":{\"standoff\":15},\"ticks\":\"\",\"automargin\":true,\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"zerolinewidth\":2.0},\"annotationdefaults\":{\"arrowcolor\":\"#2a3f5f\",\"arrowhead\":0,\"arrowwidth\":1},\"shapedefaults\":{\"line\":{\"color\":\"rgba(42, 63, 95, 1.0)\"}},\"colorway\":[\"rgba(99, 110, 250, 1.0)\",\"rgba(239, 85, 59, 1.0)\",\"rgba(0, 204, 150, 1.0)\",\"rgba(171, 99, 250, 1.0)\",\"rgba(255, 161, 90, 1.0)\",\"rgba(25, 211, 243, 1.0)\",\"rgba(255, 102, 146, 1.0)\",\"rgba(182, 232, 128, 1.0)\",\"rgba(255, 151, 255, 1.0)\",\"rgba(254, 203, 82, 1.0)\"]},\"data\":{\"bar\":[{\"marker\":{\"line\":{\"color\":\"rgba(229, 236, 246, 1.0)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"error_x\":{\"color\":\"rgba(42, 63, 95, 1.0)\"},\"error_y\":{\"color\":\"rgba(42, 63, 95, 1.0)\"}}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"rgba(229, 236, 246, 1.0)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}}}],\"carpet\":[{\"aaxis\":{\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"endlinecolor\":\"rgba(42, 63, 95, 1.0)\",\"minorgridcolor\":\"rgba(255, 255, 255, 1.0)\",\"startlinecolor\":\"rgba(42, 63, 95, 1.0)\"},\"baxis\":{\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"endlinecolor\":\"rgba(42, 63, 95, 1.0)\",\"minorgridcolor\":\"rgba(255, 255, 255, 1.0)\",\"startlinecolor\":\"rgba(42, 63, 95, 1.0)\"}}],\"choropleth\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"contour\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"contourcarpet\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}],\"heatmap\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"heatmapgl\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}}}],\"histogram2d\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"histogram2dcontour\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"mesh3d\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}],\"parcoords\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"pie\":[{\"automargin\":true}],\"scatter\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scatter3d\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}},\"line\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scattercarpet\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scattergeo\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scattergl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scattermapbox\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scatterpolar\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scatterpolargl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scatterternary\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"surface\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"table\":[{\"cells\":{\"fill\":{\"color\":\"rgba(235, 240, 248, 1.0)\"},\"line\":{\"color\":\"rgba(255, 255, 255, 1.0)\"}},\"header\":{\"fill\":{\"color\":\"rgba(200, 212, 227, 1.0)\"},\"line\":{\"color\":\"rgba(255, 255, 255, 1.0)\"}}}]}},\"xaxis\":{\"title\":{\"text\":\"X\"},\"showgrid\":false}};\r\n",
              "            var config = {\"responsive\":true};\r\n",
              "            Plotly.newPlot('30ffb494-4c64-4b89-9ca2-8e92f747a6de', data, layout, config);\r\n",
              "});\r\n",
              "            };\r\n",
              "            if ((typeof(requirejs) !==  typeof(Function)) || (typeof(requirejs.config) !== typeof(Function))) {\r\n",
              "                var script = document.createElement(\"script\");\r\n",
              "                script.setAttribute(\"src\", \"https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js\");\r\n",
              "                script.onload = function(){\r\n",
              "                    renderPlotly_30ffb4944c644b899ca28e92f747a6de();\r\n",
              "                };\r\n",
              "                document.getElementsByTagName(\"head\")[0].appendChild(script);\r\n",
              "            }\r\n",
              "            else {\r\n",
              "                renderPlotly_30ffb4944c644b899ca28e92f747a6de();\r\n",
              "            }\r\n",
              "</script>\r\n",
              "\n",
              "    \n",
              "</div>    \n"
            ]
          },
          "execution_count": 1,
          "metadata": {}
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Calculate and graph the Permutation Feature Importance (PFI)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "dotnet_interactive": {
          "language": "csharp"
        }
      },
      "source": [
        "// Calculate PFI\n",
        "var preprocessedTrainData = model.Transform(df);\n",
        "\n",
        "ImmutableDictionary<string, RegressionMetricsStatistics> permutationFeatureImportance =\n",
        "    mlContext.Regression\n",
        "\t.PermutationFeatureImportance(\n",
        "                model,\n",
        "                preprocessedTrainData,\n",
        "                labelColumnName: \"fare_amount\",\n",
        "                useFeatureWeightFilter: false,\n",
        "                numberOfExamplesToUse: null,\n",
        "                permutationCount: 1);\n",
        "\n",
        "var featureImportanceMetrics =\n",
        "     permutationFeatureImportance\n",
        "     .Select((kvp) => new { kvp.Key, kvp.Value.RSquared })\n",
        "     .OrderByDescending(myFeatures => Math.Abs(myFeatures.RSquared.Mean));\n",
        "\n",
        "    \n",
        "var featureNames = new List<string>();\n",
        "var featurePFI = new List<double>();\n",
        "foreach (var feature in featureImportanceMetrics)\n",
        "{\n",
        "     featureNames.Add(feature.Key);\n",
        "     featurePFI.Add(Math.Abs(feature.RSquared.Mean));\n",
        "}\n",
        "var featureImportance = new DataFrame(new StringDataFrameColumn(\"Feature\", featureNames.ToArray() ), new DoubleDataFrameColumn(\"R-Squared Impact\",featurePFI.ToArray()));\n",
        "    \n",
        "featureImportance"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<table id=\"table_637927237161207831\"><thead><tr><th><i>index</i></th><th>Feature</th><th>R-Squared Impact</th></tr></thead><tbody><tr><td><i><div class=\"dni-plaintext\">0</div></i></td><td>trip_distance</td><td><div class=\"dni-plaintext\">0.6755704315755394</div></td></tr><tr><td><i><div class=\"dni-plaintext\">1</div></i></td><td>rate_code</td><td><div class=\"dni-plaintext\">0.4330715253461801</div></td></tr><tr><td><i><div class=\"dni-plaintext\">2</div></i></td><td>trip_time_in_secs</td><td><div class=\"dni-plaintext\">0.30444644630706363</div></td></tr><tr><td><i><div class=\"dni-plaintext\">3</div></i></td><td>vendor_id.Bit0</td><td><div class=\"dni-plaintext\">0</div></td></tr><tr><td><i><div class=\"dni-plaintext\">4</div></i></td><td>payment_type.Bit3</td><td><div class=\"dni-plaintext\">0</div></td></tr><tr><td><i><div class=\"dni-plaintext\">5</div></i></td><td>vendor_id.Bit1</td><td><div class=\"dni-plaintext\">0</div></td></tr><tr><td><i><div class=\"dni-plaintext\">6</div></i></td><td>payment_type.Bit1</td><td><div class=\"dni-plaintext\">0</div></td></tr><tr><td><i><div class=\"dni-plaintext\">7</div></i></td><td>payment_type.Bit0</td><td><div class=\"dni-plaintext\">0</div></td></tr><tr><td><i><div class=\"dni-plaintext\">8</div></i></td><td>vendor_id.Bit2</td><td><div class=\"dni-plaintext\">0</div></td></tr><tr><td><i><div class=\"dni-plaintext\">9</div></i></td><td>passenger_count</td><td><div class=\"dni-plaintext\">0</div></td></tr><tr><td><i><div class=\"dni-plaintext\">10</div></i></td><td>payment_type.Bit2</td><td><div class=\"dni-plaintext\">0</div></td></tr></tbody></table>"
            ]
          },
          "execution_count": 1,
          "metadata": {}
        }
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "dotnet_interactive": {
          "language": "csharp"
        }
      },
      "source": [
        "Plotly.NET.CSharp.Chart.Bar<double, string, string>(values: featurePFI, Keys: featureNames)\n",
        ".WithTraceInfo(Name: \"Hello from C#\", ShowLegend: false)\n",
        ".WithXAxisStyle<double, double, string>(TitleText: \"Feature\")\n",
        ".WithYAxisStyle<double, double, string>(TitleText: \"Contribution (delta R-Squared)\")"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "\n",
              "<div>\n",
              "    <div id=\"0d7cea81-b0d6-49fe-b154-375e75407ab0\"><!-- Plotly chart will be drawn inside this DIV --></div>\r\n",
              "<script type=\"text/javascript\">\r\n",
              "\r\n",
              "            var renderPlotly_0d7cea81b0d649feb154375e75407ab0 = function() {\r\n",
              "            var fsharpPlotlyRequire = requirejs.config({context:'fsharp-plotly',paths:{plotly:'https://cdn.plot.ly/plotly-2.6.3.min'}}) || require;\r\n",
              "            fsharpPlotlyRequire(['plotly'], function(Plotly) {\r\n",
              "\r\n",
              "            var data = [{\"type\":\"bar\",\"x\":[0.6755704315755394,0.4330715253461801,0.30444644630706363,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],\"y\":[\"trip_distance\",\"rate_code\",\"trip_time_in_secs\",\"vendor_id.Bit0\",\"payment_type.Bit3\",\"vendor_id.Bit1\",\"payment_type.Bit1\",\"payment_type.Bit0\",\"vendor_id.Bit2\",\"passenger_count\",\"payment_type.Bit2\"],\"orientation\":\"h\",\"marker\":{\"pattern\":{}},\"name\":\"Hello from C#\",\"showlegend\":false}];\r\n",
              "            var layout = {\"width\":600,\"height\":600,\"template\":{\"layout\":{\"title\":{\"x\":0.05},\"font\":{\"color\":\"rgba(42, 63, 95, 1.0)\"},\"paper_bgcolor\":\"rgba(255, 255, 255, 1.0)\",\"plot_bgcolor\":\"rgba(229, 236, 246, 1.0)\",\"autotypenumbers\":\"strict\",\"colorscale\":{\"diverging\":[[0.0,\"#8e0152\"],[0.1,\"#c51b7d\"],[0.2,\"#de77ae\"],[0.3,\"#f1b6da\"],[0.4,\"#fde0ef\"],[0.5,\"#f7f7f7\"],[0.6,\"#e6f5d0\"],[0.7,\"#b8e186\"],[0.8,\"#7fbc41\"],[0.9,\"#4d9221\"],[1.0,\"#276419\"]],\"sequential\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"sequentialminus\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]},\"hovermode\":\"closest\",\"hoverlabel\":{\"align\":\"left\"},\"coloraxis\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}},\"geo\":{\"showland\":true,\"landcolor\":\"rgba(229, 236, 246, 1.0)\",\"showlakes\":true,\"lakecolor\":\"rgba(255, 255, 255, 1.0)\",\"subunitcolor\":\"rgba(255, 255, 255, 1.0)\",\"bgcolor\":\"rgba(255, 255, 255, 1.0)\"},\"mapbox\":{\"style\":\"light\"},\"polar\":{\"bgcolor\":\"rgba(229, 236, 246, 1.0)\",\"radialaxis\":{\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"ticks\":\"\"},\"angularaxis\":{\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"ticks\":\"\"}},\"scene\":{\"xaxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"gridwidth\":2.0,\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"backgroundcolor\":\"rgba(229, 236, 246, 1.0)\",\"showbackground\":true},\"yaxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"gridwidth\":2.0,\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"backgroundcolor\":\"rgba(229, 236, 246, 1.0)\",\"showbackground\":true},\"zaxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"gridwidth\":2.0,\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"backgroundcolor\":\"rgba(229, 236, 246, 1.0)\",\"showbackground\":true}},\"ternary\":{\"aaxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\"},\"baxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\"},\"caxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\"},\"bgcolor\":\"rgba(229, 236, 246, 1.0)\"},\"xaxis\":{\"title\":{\"standoff\":15},\"ticks\":\"\",\"automargin\":true,\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"zerolinewidth\":2.0},\"yaxis\":{\"title\":{\"standoff\":15},\"ticks\":\"\",\"automargin\":true,\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"zerolinewidth\":2.0},\"annotationdefaults\":{\"arrowcolor\":\"#2a3f5f\",\"arrowhead\":0,\"arrowwidth\":1},\"shapedefaults\":{\"line\":{\"color\":\"rgba(42, 63, 95, 1.0)\"}},\"colorway\":[\"rgba(99, 110, 250, 1.0)\",\"rgba(239, 85, 59, 1.0)\",\"rgba(0, 204, 150, 1.0)\",\"rgba(171, 99, 250, 1.0)\",\"rgba(255, 161, 90, 1.0)\",\"rgba(25, 211, 243, 1.0)\",\"rgba(255, 102, 146, 1.0)\",\"rgba(182, 232, 128, 1.0)\",\"rgba(255, 151, 255, 1.0)\",\"rgba(254, 203, 82, 1.0)\"]},\"data\":{\"bar\":[{\"marker\":{\"line\":{\"color\":\"rgba(229, 236, 246, 1.0)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"error_x\":{\"color\":\"rgba(42, 63, 95, 1.0)\"},\"error_y\":{\"color\":\"rgba(42, 63, 95, 1.0)\"}}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"rgba(229, 236, 246, 1.0)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}}}],\"carpet\":[{\"aaxis\":{\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"endlinecolor\":\"rgba(42, 63, 95, 1.0)\",\"minorgridcolor\":\"rgba(255, 255, 255, 1.0)\",\"startlinecolor\":\"rgba(42, 63, 95, 1.0)\"},\"baxis\":{\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"endlinecolor\":\"rgba(42, 63, 95, 1.0)\",\"minorgridcolor\":\"rgba(255, 255, 255, 1.0)\",\"startlinecolor\":\"rgba(42, 63, 95, 1.0)\"}}],\"choropleth\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"contour\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"contourcarpet\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}],\"heatmap\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"heatmapgl\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}}}],\"histogram2d\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"histogram2dcontour\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"mesh3d\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}],\"parcoords\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"pie\":[{\"automargin\":true}],\"scatter\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scatter3d\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}},\"line\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scattercarpet\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scattergeo\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scattergl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scattermapbox\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scatterpolar\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scatterpolargl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scatterternary\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"surface\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"table\":[{\"cells\":{\"fill\":{\"color\":\"rgba(235, 240, 248, 1.0)\"},\"line\":{\"color\":\"rgba(255, 255, 255, 1.0)\"}},\"header\":{\"fill\":{\"color\":\"rgba(200, 212, 227, 1.0)\"},\"line\":{\"color\":\"rgba(255, 255, 255, 1.0)\"}}}]}},\"xaxis\":{\"title\":{\"text\":\"Feature\"}},\"yaxis\":{\"title\":{\"text\":\"Contribution (delta R-Squared)\"}}};\r\n",
              "            var config = {\"responsive\":true};\r\n",
              "            Plotly.newPlot('0d7cea81-b0d6-49fe-b154-375e75407ab0', data, layout, config);\r\n",
              "});\r\n",
              "            };\r\n",
              "            if ((typeof(requirejs) !==  typeof(Function)) || (typeof(requirejs.config) !== typeof(Function))) {\r\n",
              "                var script = document.createElement(\"script\");\r\n",
              "                script.setAttribute(\"src\", \"https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js\");\r\n",
              "                script.onload = function(){\r\n",
              "                    renderPlotly_0d7cea81b0d649feb154375e75407ab0();\r\n",
              "                };\r\n",
              "                document.getElementsByTagName(\"head\")[0].appendChild(script);\r\n",
              "            }\r\n",
              "            else {\r\n",
              "                renderPlotly_0d7cea81b0d649feb154375e75407ab0();\r\n",
              "            }\r\n",
              "</script>\r\n",
              "\n",
              "    \n",
              "</div>    \n"
            ]
          },
          "execution_count": 1,
          "metadata": {}
        }
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "dotnet_interactive": {
          "language": "csharp"
        }
      },
      "source": [
        "var topFeatureName = featureNames.First();\n",
        "float[] fare_amount = df.GetColumn<float>(\"fare_amount\").Take(numberOfRows).ToArray();\n",
        "float[] topFeature = df.GetColumn<float>(topFeatureName).Take(numberOfRows).ToArray();\n",
        "\n",
        "Plotly.NET.CSharp.Chart.Point<float, float, string>(topFeature, fare_amount, \"Hello\")\n",
        ".WithTraceInfo(Name: \"Hello from C#\", ShowLegend: true)\n",
        ".WithXAxisStyle<float, float, string>(TitleText: topFeatureName, ShowGrid: false)\n",
        ".WithYAxisStyle<float, float, string>(TitleText: \"fare_amount\", ShowGrid: false)"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "\n",
              "<div>\n",
              "    <div id=\"9f8a13da-8ceb-4706-9736-05ef9092e70c\"><!-- Plotly chart will be drawn inside this DIV --></div>\r\n",
              "<script type=\"text/javascript\">\r\n",
              "\r\n",
              "            var renderPlotly_9f8a13da8ceb4706973605ef9092e70c = function() {\r\n",
              "            var fsharpPlotlyRequire = requirejs.config({context:'fsharp-plotly',paths:{plotly:'https://cdn.plot.ly/plotly-2.6.3.min'}}) || require;\r\n",
              "            fsharpPlotlyRequire(['plotly'], function(Plotly) {\r\n",
              "\r\n",
              "            var data = [{\"type\":\"scatter\",\"name\":\"Hello from C#\",\"mode\":\"markers\",\"x\":[3.8,1.5,1.4,0.6,1.1,9.6,2.3,1.4,1.5,0.6,1.2,0.7,1.3,0.8,1.1,5.6,0.6,1.3,1.7,0.6,0.0,0.8,0.4,0.6,1.4,0.8,9.8,1.4,1.4,2.0,0.5,1.3,3.8,1.4,2.5,1.4,0.4,0.8,1.0,4.7,16.4,2.1,1.3,0.6,6.5,1.7,2.4,0.4,1.1,0.5,3.6,1.1,9.3,0.9,1.3,6.9,2.6,1.1,0.9,2.6,3.7,0.9,2.0,6.3,2.4,1.1,1.4,1.6,0.8,1.5,3.4,1.6,1.1,18.8,1.6,1.8,1.0,0.7,5.9,1.2,3.7,0.4,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5,5.0,6.5,6.5,5.0,13.0,11.0,32.5,12.0,11.0,7.5,8.0,11.5,6.0,11.0,15.0,13.0,9.5,25.0,9.5,7.0,4.5,6.5,10.0,7.0,7.0,26.5,7.5,10.0,7.0,10.0,11.5,4.0,8.0,12.0,4.0,5.5,9.5,15.5,7.0,15.5,3.5,2.5,9.0,5.0,6.0,5.5,30.5,3.0,16.0,7.0,5.5,39.5,35.0,5.5,3.5,8.5,12.0,8.0,7.0,7.5,7.5,14.5,7.0,20.5,21.5,6.0,6.5,6.5,8.0,13.5,5.5,39.0,6.0,17.0,12.5,24.5,11.0,10.0,7.0,15.5,9.5,22.0,17.0,8.0,22.0,7.0,8.0,15.5,12.0,3.0,9.0,14.5,16.5,6.5,13.5,7.5,25.5,13.0,14.0,15.5,5.5,5.0,14.5,9.0,5.0,6.5,4.5,8.5,14.0,40.0,5.0,10.5,6.0,8.0,34.0,11.0,6.5,6.0,9.0,7.0,10.5,15.0,8.0,4.5,11.0,6.0,10.5,12.0,17.0,5.0,5.0,11.5,24.5,52.0,4.5,4.0,6.0,14.0,5.0,8.0,12.0,5.0,14.0,7.0,14.0,7.0,9.5,9.5,12.0,20.0,6.0,12.5,7.5,4.5,25.5,4.5,14.0,10.0,12.5,7.5,9.0,6.5,8.5,4.0,8.5,4.0,7.0,37.5,20.0,15.5,5.0,8.5,7.5,15.5,13.5,6.5,8.5,3.5,8.5,7.5,6.5,5.5,18.0,7.0,16.0,28.0,9.5,15.0,6.5,31.5,5.0,30.5,5.5,11.0,14.5,10.5,7.0,34.0,10.0,9.0,11.5,5.0,2.5,5.0,8.5,4.5,11.0,6.0,23.5,11.5,2.5,9.5,11.5,24.5,25.0,14.0,11.5,9.0,10.5,15.5,26.5,15.0,6.0,11.5,9.5,25.0,9.5,6.0,6.5,6.5,4.0,6.5,13.5,10.5,9.0,9.0,4.0,4.5,8.5,13.5,5.0,19.0,15.5,9.0,4.5,17.5,7.0,34.5,10.0,21.0,11.0,10.0,19.5,15.5,7.5,5.0,7.5,5.5,13.5,8.5,15.0,5.5,5.0,11.0,6.5,4.0,4.0,8.5,8.0,6.0,8.5,17.0,9.5,26.5,4.0,5.0,6.5,7.0,8.5,28.5,5.0,7.0,7.0,4.5,10.5,13.5,8.0,4.5,15.0,7.5,11.0,5.5,6.5,19.5,5.0,6.5,4.5,8.0,14.0,9.0,24.0,6.5,13.0,5.0,12.0,4.5,8.0,32.5,21.5,6.5,5.0,2.5,16.5,9.5,8.5,8.5,10.5,7.0,13.0,15.0,6.5,13.0,5.5,13.0,8.0,24.5,12.0,7.5,8.0,7.5,11.0,11.0,9.5,7.0,4.0,6.5,14.5,10.0,8.5,7.0,6.5,5.5,14.0,3.5,11.0,8.0,7.0,12.0,5.0,6.5,8.5,14.0,6.0,10.0,14.0,11.0,12.0,4.5,6.0,16.0,19.0,16.0,8.0,6.0,7.0,22.5,3.5,7.5,7.0,5.5,11.5,4.0,8.5,14.5,11.5,5.5,11.5,6.0,11.0,9.5,19.5,9.5,8.5],\"marker\":{},\"line\":{},\"showlegend\":true}];\r\n",
              "            var layout = {\"width\":600,\"height\":600,\"template\":{\"layout\":{\"title\":{\"x\":0.05},\"font\":{\"color\":\"rgba(42, 63, 95, 1.0)\"},\"paper_bgcolor\":\"rgba(255, 255, 255, 1.0)\",\"plot_bgcolor\":\"rgba(229, 236, 246, 1.0)\",\"autotypenumbers\":\"strict\",\"colorscale\":{\"diverging\":[[0.0,\"#8e0152\"],[0.1,\"#c51b7d\"],[0.2,\"#de77ae\"],[0.3,\"#f1b6da\"],[0.4,\"#fde0ef\"],[0.5,\"#f7f7f7\"],[0.6,\"#e6f5d0\"],[0.7,\"#b8e186\"],[0.8,\"#7fbc41\"],[0.9,\"#4d9221\"],[1.0,\"#276419\"]],\"sequential\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"sequentialminus\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]},\"hovermode\":\"closest\",\"hoverlabel\":{\"align\":\"left\"},\"coloraxis\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}},\"geo\":{\"showland\":true,\"landcolor\":\"rgba(229, 236, 246, 1.0)\",\"showlakes\":true,\"lakecolor\":\"rgba(255, 255, 255, 1.0)\",\"subunitcolor\":\"rgba(255, 255, 255, 1.0)\",\"bgcolor\":\"rgba(255, 255, 255, 1.0)\"},\"mapbox\":{\"style\":\"light\"},\"polar\":{\"bgcolor\":\"rgba(229, 236, 246, 1.0)\",\"radialaxis\":{\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"ticks\":\"\"},\"angularaxis\":{\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"ticks\":\"\"}},\"scene\":{\"xaxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"gridwidth\":2.0,\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"backgroundcolor\":\"rgba(229, 236, 246, 1.0)\",\"showbackground\":true},\"yaxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"gridwidth\":2.0,\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"backgroundcolor\":\"rgba(229, 236, 246, 1.0)\",\"showbackground\":true},\"zaxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"gridwidth\":2.0,\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"backgroundcolor\":\"rgba(229, 236, 246, 1.0)\",\"showbackground\":true}},\"ternary\":{\"aaxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\"},\"baxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\"},\"caxis\":{\"ticks\":\"\",\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\"},\"bgcolor\":\"rgba(229, 236, 246, 1.0)\"},\"xaxis\":{\"title\":{\"standoff\":15},\"ticks\":\"\",\"automargin\":true,\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"zerolinewidth\":2.0},\"yaxis\":{\"title\":{\"standoff\":15},\"ticks\":\"\",\"automargin\":true,\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"zerolinecolor\":\"rgba(255, 255, 255, 1.0)\",\"zerolinewidth\":2.0},\"annotationdefaults\":{\"arrowcolor\":\"#2a3f5f\",\"arrowhead\":0,\"arrowwidth\":1},\"shapedefaults\":{\"line\":{\"color\":\"rgba(42, 63, 95, 1.0)\"}},\"colorway\":[\"rgba(99, 110, 250, 1.0)\",\"rgba(239, 85, 59, 1.0)\",\"rgba(0, 204, 150, 1.0)\",\"rgba(171, 99, 250, 1.0)\",\"rgba(255, 161, 90, 1.0)\",\"rgba(25, 211, 243, 1.0)\",\"rgba(255, 102, 146, 1.0)\",\"rgba(182, 232, 128, 1.0)\",\"rgba(255, 151, 255, 1.0)\",\"rgba(254, 203, 82, 1.0)\"]},\"data\":{\"bar\":[{\"marker\":{\"line\":{\"color\":\"rgba(229, 236, 246, 1.0)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"error_x\":{\"color\":\"rgba(42, 63, 95, 1.0)\"},\"error_y\":{\"color\":\"rgba(42, 63, 95, 1.0)\"}}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"rgba(229, 236, 246, 1.0)\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}}}],\"carpet\":[{\"aaxis\":{\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"endlinecolor\":\"rgba(42, 63, 95, 1.0)\",\"minorgridcolor\":\"rgba(255, 255, 255, 1.0)\",\"startlinecolor\":\"rgba(42, 63, 95, 1.0)\"},\"baxis\":{\"linecolor\":\"rgba(255, 255, 255, 1.0)\",\"gridcolor\":\"rgba(255, 255, 255, 1.0)\",\"endlinecolor\":\"rgba(42, 63, 95, 1.0)\",\"minorgridcolor\":\"rgba(255, 255, 255, 1.0)\",\"startlinecolor\":\"rgba(42, 63, 95, 1.0)\"}}],\"choropleth\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"contour\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"contourcarpet\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}],\"heatmap\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"heatmapgl\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}}}],\"histogram2d\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"histogram2dcontour\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"mesh3d\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}],\"parcoords\":[{\"line\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"pie\":[{\"automargin\":true}],\"scatter\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scatter3d\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}},\"line\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scattercarpet\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scattergeo\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scattergl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scattermapbox\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scatterpolar\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scatterpolargl\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"scatterternary\":[{\"marker\":{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"}}}],\"surface\":[{\"colorbar\":{\"outlinewidth\":0.0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"table\":[{\"cells\":{\"fill\":{\"color\":\"rgba(235, 240, 248, 1.0)\"},\"line\":{\"color\":\"rgba(255, 255, 255, 1.0)\"}},\"header\":{\"fill\":{\"color\":\"rgba(200, 212, 227, 1.0)\"},\"line\":{\"color\":\"rgba(255, 255, 255, 1.0)\"}}}]}},\"xaxis\":{\"title\":{\"text\":\"trip_distance\"},\"showgrid\":false},\"yaxis\":{\"title\":{\"text\":\"fare_amount\"},\"showgrid\":false}};\r\n",
              "            var config = {\"responsive\":true};\r\n",
              "            Plotly.newPlot('9f8a13da-8ceb-4706-9736-05ef9092e70c', data, layout, config);\r\n",
              "});\r\n",
              "            };\r\n",
              "            if ((typeof(requirejs) !==  typeof(Function)) || (typeof(requirejs.config) !== typeof(Function))) {\r\n",
              "                var script = document.createElement(\"script\");\r\n",
              "                script.setAttribute(\"src\", \"https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js\");\r\n",
              "                script.onload = function(){\r\n",
              "                    renderPlotly_9f8a13da8ceb4706973605ef9092e70c();\r\n",
              "                };\r\n",
              "                document.getElementsByTagName(\"head\")[0].appendChild(script);\r\n",
              "            }\r\n",
              "            else {\r\n",
              "                renderPlotly_9f8a13da8ceb4706973605ef9092e70c();\r\n",
              "            }\r\n",
              "</script>\r\n",
              "\n",
              "    \n",
              "</div>    \n"
            ]
          },
          "execution_count": 1,
          "metadata": {}
        }
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": ".NET (C#)",
      "language": "C#",
      "name": ".net-csharp"
    },
    "language_info": {
      "file_extension": ".cs",
      "mimetype": "text/x-csharp",
      "name": "C#",
      "pygments_lexer": "csharp",
      "version": "8.0"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 4
}